<template>
  <div class="title flex-c f36 lh100">移动端：vue3+vite2+vant3+ts+axios+less</div>
  <div class="flex-c">
    <van-button class="btn"  block type="primary" @click="apiTest">主要按钮</van-button>
  </div>
  <van-cell-group inset>
  <van-field v-model="val" label="文本" placeholder="请输入用户名" />
</van-cell-group>
</template>

<script lang="ts">
import { onMounted,toRefs,reactive } from 'vue'
import { lhTest} from '@/http/api'
import {
  IndexState,
  lhTestRes
} from "@/type/index";

export default {
  name: "Index",
  components: {
  },
  setup() {
    const state:IndexState = reactive({
      val:''
    })

    const apiTest = () =>{
     lhTest({
        test:'test'
      }).then((res)=>{
        console.log('res res',res)
      })
    }
    onMounted(()=>{
    })
    return {
        ...toRefs(state),
        apiTest,
    };
  },
};
</script>

<style scope>
    .btn{
      width: 700px; 
    }
</style>
